package com.wzy.designpattern.structural.composite;

/**
 * 描述
 * 创建人    Wzy
 * 创建时间: 2020-05-16  3:53
 */
public class Test {
    public static void main(String[] args) {
        CatalogComponent linuxCourse = new Course("linux课程", 11);
        CatalogComponent WindowsCourse = new Course("windows课程", 22);

        CatalogComponent javaCourseCatalog = new CourseCatalog("java课程目录", 2);

        CatalogComponent mmallCourse1 = new Course("java电商1", 55);
        CatalogComponent mmallCourse2 = new Course("java电商2", 55);
        CatalogComponent designPatternCourse = new Course("java设计模式", 66);


        javaCourseCatalog.add(mmallCourse1);
        javaCourseCatalog.add(mmallCourse2);
        javaCourseCatalog.add(designPatternCourse);

        CatalogComponent mainCourseCatalog = new CourseCatalog("课程主目录", 1);

        mainCourseCatalog.add(linuxCourse);
        mainCourseCatalog.add(WindowsCourse);
        mainCourseCatalog.add(javaCourseCatalog);

        mainCourseCatalog.print();
    }
}
